
package de.swta.freezay.components;

import de.swta.freezay.database.dbEntities.Unit;
import org.apache.wicket.markup.html.form.IChoiceRenderer;

/**
 * Special IChoiceRenderer for unit entities
 *
 * @author Jan Korreck
 * @see IChoiceRenderer
 */
public class UnitChoiceRenderer implements IChoiceRenderer<Unit> {

    @Override
    public Object getDisplayValue(Unit unit) {
        return "" + unit.getName();
    }

    @Override
    public String getIdValue(Unit unit, int listIndex) {
        return "" + unit.getId();
    }
    
}
